package educrypt.commons.util;

public class MathUtil {

	// Greatest Common Divisor
	public static int GCD(int a, int b) {
		if (b == 0)
			return a;
		return GCD(b, a % b);
	}

	public static int changeBase(int operand, int modularBase) {
		return (modularBase + (operand % modularBase)) % modularBase;
	}

	public static boolean isNatural(double number) {
		boolean isInteger = Math.ceil(number) == number;
		return isInteger;
	}

}
